FROM microsoft/aspnetcore-build AS build-env
WORKDIR /code
COPY *.sln /code
RUN dotnet restore

COPY . /code
run dotnet publish -c release -o /code/out

FROM microsoft/aspnetcore 
WORKDIR /app
COPY --from=build-env /code/out /app
EXPOSE 8000
ENTRYPOINT ["dotnet","UserAPI.dll"]